Optimal. Leaf size=66 \[ \frac {15 x}{8 a}+\frac {4 \cos (x)}{a}-\frac {4 \cos ^3(x)}{3 a}-\frac {15 \cos (x) \sin (x)}{8 a}-\frac {5 \cos (x) \sin ^3(x)}{4 a}+\frac {\cos (x) \sin ^3(x)}{a+a \csc (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3904, 3872,
2715, 8, 2713} \begin {gather*} \frac {15 x}{8 a}-\frac {4 \cos ^3(x)}{3 a}+\frac {4 \cos (x)}{a}-\frac {5 \sin ^3(x) \cos (x)}{4 a}-\frac {15 \sin (x) \cos (x)}{8 a}+\frac {\sin ^3(x) \cos (x)}{a \csc (x)+a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 3872
Rule 3904
Rubi steps
\begin {align*} \int \frac {\sin ^4(x)}{a+a \csc (x)} \, dx &=\frac {\cos (x) \sin ^3(x)}{a+a \csc (x)}-\frac {\int (-5 a+4 a \csc (x)) \sin ^4(x) \, dx}{a^2}\\ &=\frac {\cos (x) \sin ^3(x)}{a+a \csc (x)}-\frac {4 \int \sin ^3(x) \, dx}{a}+\frac {5 \int \sin ^4(x) \, dx}{a}\\ &=-\frac {5 \cos (x) \sin ^3(x)}{4 a}+\frac {\cos (x) \sin ^3(x)}{a+a \csc (x)}+\frac {15 \int \sin ^2(x) \, dx}{4 a}+\frac {4 \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (x)\right )}{a}\\ &=\frac {4 \cos (x)}{a}-\frac {4 \cos ^3(x)}{3 a}-\frac {15 \cos (x) \sin (x)}{8 a}-\frac {5 \cos (x) \sin ^3(x)}{4 a}+\frac {\cos (x) \sin ^3(x)}{a+a \csc (x)}+\frac {15 \int 1 \, dx}{8 a}\\ &=\frac {15 x}{8 a}+\frac {4 \cos (x)}{a}-\frac {4 \cos ^3(x)}{3 a}-\frac {15 \cos (x) \sin (x)}{8 a}-\frac {5 \cos (x) \sin ^3(x)}{4 a}+\frac {\cos (x) \sin ^3(x)}{a+a \csc (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.23, size = 57, normalized size = 0.86 \begin {gather*} \frac {168 \cos (x)-8 \cos (3 x)+3 \left (60 x-\frac {64 \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )}-16 \sin (2 x)+\sin (4 x)\right )}{96 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 90, normalized size = 1.36
method | result | size |
risch | \(\frac {15 x}{8 a}+\frac {7 \,{\mathrm e}^{i x}}{8 a}+\frac {7 \,{\mathrm e}^{-i x}}{8 a}+\frac {2}{\left (i+{\mathrm e}^{i x}\right ) a}+\frac {\sin \left (4 x \right )}{32 a}-\frac {\cos \left (3 x \right )}{12 a}-\frac {\sin \left (2 x \right )}{2 a}\) | \(70\) |
default | \(\frac {\frac {64}{32 \tan \left (\frac {x}{2}\right )+32}+\frac {2 \left (\frac {7 \left (\tan ^{7}\left (\frac {x}{2}\right )\right )}{8}+\tan ^{6}\left (\frac {x}{2}\right )+\frac {15 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{8}+5 \left (\tan ^{4}\left (\frac {x}{2}\right )\right )-\frac {15 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{8}+\frac {17 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{3}-\frac {7 \tan \left (\frac {x}{2}\right )}{8}+\frac {5}{3}\right )}{\left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{4}}+\frac {15 \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{4}}{a}\) | \(90\) |
norman | \(\frac {\frac {15 x}{8 a}+\frac {15}{4 a}+\frac {15 x \tan \left (\frac {x}{2}\right )}{8 a}+\frac {15 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {15 x \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {45 x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{4 a}+\frac {45 x \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{4 a}+\frac {15 x \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {15 x \left (\tan ^{7}\left (\frac {x}{2}\right )\right )}{2 a}+\frac {15 x \left (\tan ^{8}\left (\frac {x}{2}\right )\right )}{8 a}+\frac {15 x \left (\tan ^{9}\left (\frac {x}{2}\right )\right )}{8 a}+\frac {13 \left (\tan ^{8}\left (\frac {x}{2}\right )\right )}{6 a}-\frac {19 \left (\tan ^{9}\left (\frac {x}{2}\right )\right )}{12 a}+\frac {5 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{4 a}+\frac {45 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{4 a}+\frac {17 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{4 a}+\frac {35 \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{4 a}-\frac {31 \left (\tan ^{7}\left (\frac {x}{2}\right )\right )}{12 a}+\frac {89 \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{12 a}}{\left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{4} \left (\tan \left (\frac {x}{2}\right )+1\right )}\) | \(226\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 230 vs.
\(2 (58) = 116\).
time = 0.48, size = 230, normalized size = 3.48 \begin {gather*} \frac {\frac {19 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {211 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {91 \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {219 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {165 \, \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}} + \frac {165 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} + \frac {45 \, \sin \left (x\right )^{7}}{{\left (\cos \left (x\right ) + 1\right )}^{7}} + \frac {45 \, \sin \left (x\right )^{8}}{{\left (\cos \left (x\right ) + 1\right )}^{8}} + 64}{12 \, {\left (a + \frac {a \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {4 \, a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {4 \, a \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {6 \, a \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {6 \, a \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}} + \frac {4 \, a \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} + \frac {4 \, a \sin \left (x\right )^{7}}{{\left (\cos \left (x\right ) + 1\right )}^{7}} + \frac {a \sin \left (x\right )^{8}}{{\left (\cos \left (x\right ) + 1\right )}^{8}} + \frac {a \sin \left (x\right )^{9}}{{\left (\cos \left (x\right ) + 1\right )}^{9}}\right )}} + \frac {15 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{4 \, a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.89, size = 81, normalized size = 1.23 \begin {gather*} -\frac {6 \, \cos \left (x\right )^{5} + 8 \, \cos \left (x\right )^{4} - 25 \, \cos \left (x\right )^{3} - 45 \, {\left (x + 1\right )} \cos \left (x\right ) - 48 \, \cos \left (x\right )^{2} - {\left (6 \, \cos \left (x\right )^{4} - 2 \, \cos \left (x\right )^{3} - 27 \, \cos \left (x\right )^{2} + 45 \, x + 21 \, \cos \left (x\right ) - 24\right )} \sin \left (x\right ) - 45 \, x - 24}{24 \, {\left (a \cos \left (x\right ) + a \sin \left (x\right ) + a\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\sin ^{4}{\left (x \right )}}{\csc {\left (x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 91, normalized size = 1.38 \begin {gather*} \frac {15 \, x}{8 \, a} + \frac {2}{a {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}} + \frac {21 \, \tan \left (\frac {1}{2} \, x\right )^{7} + 24 \, \tan \left (\frac {1}{2} \, x\right )^{6} + 45 \, \tan \left (\frac {1}{2} \, x\right )^{5} + 120 \, \tan \left (\frac {1}{2} \, x\right )^{4} - 45 \, \tan \left (\frac {1}{2} \, x\right )^{3} + 136 \, \tan \left (\frac {1}{2} \, x\right )^{2} - 21 \, \tan \left (\frac {1}{2} \, x\right ) + 40}{12 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}^{4} a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.40, size = 93, normalized size = 1.41 \begin {gather*} \frac {15\,x}{8\,a}+\frac {\frac {15\,{\mathrm {tan}\left (\frac {x}{2}\right )}^8}{4}+\frac {15\,{\mathrm {tan}\left (\frac {x}{2}\right )}^7}{4}+\frac {55\,{\mathrm {tan}\left (\frac {x}{2}\right )}^6}{4}+\frac {55\,{\mathrm {tan}\left (\frac {x}{2}\right )}^5}{4}+\frac {73\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4}{4}+\frac {91\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{12}+\frac {211\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{12}+\frac {19\,\mathrm {tan}\left (\frac {x}{2}\right )}{12}+\frac {16}{3}}{a\,{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )}^4\,\left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________